home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD013b.dsk
/
ROADRACE.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
4KB
|
104 lines
100 REM : ROADRACE
110 REM : COPYRIGHT 1980 BY PHIL FELDMAN AND TOM RUGG
120 TEXT : NORMAL : NOTRACE : SPEED= 255: HOME : CLEAR
130 U = 1:Z = 0:SC = -912:T8 = 38:F7 = 47
140 CR = 2:CC = 9
150 X = 0:Y = 0:KP = -16384:RK = -16368:L = 0:R = 0
160 LC = 0.4
170 ML = 199:MR = 200
180 EL = 1:ER = 37:F5 = 45:F6 = 46:RC = 1 -LC
190 Q = PEEK(78) +256 * PEEK(79):Q = RND( -Q): GOTO 210
200 PLOT X,Y: PLOT X -U,Y -U: PLOT X +U,Y -U: RETURN
210 GOSUB 2000: TEXT : HOME : PRINT
220 PRINT TAB( 11);"R O A D R A C E"
230 PRINT :T = 0:N = 0
235 GOSUB 4000
240 INPUT "ROAD WIDTH(3-12)? ";W
250 W = INT(W): IF W <3 OR W >12 THEN 240
260 PRINT : PRINT "VISIBILITY CONDITIONS
270 PRINT " 1 - TERRIBLE
280 PRINT " 2 - BAD
290 PRINT " 3 - FAIR
300 PRINT " 4 - GOOD": PRINT
310 INPUT "VISIBILITY (1-4)? ";V:V = INT(V)
320 IF V <1 OR V >4 THEN 310
330 N = N +1:L = 19 -W/2:R = L +W +2
340 X = 20:H = 0:Y = 47 -V *V
350 GR : POKE -16302,Z: POKE 34,U
360 POKE 33,38: POKE 32,U
370 COLOR= Z: FOR Q = 40 TO F7
380 HLIN Z,39 AT Q: NEXT
390 COLOR= CR: HLIN Z,39 AT Z: HLIN Z,39 AT U
400 VLIN Z,F7 AT Z: VLIN Z,F7 AT 39
410 HLIN Z,39 AT F7
420 FOR Q = Z TO F7: HLIN L,L +U AT Q
430 HLIN R,R +U AT Q: NEXT
440 COLOR= CC: GOSUB 200
450 GOSUB 3000
500 COLOR= Z: HLIN U,T8 AT F7: CALL SC: COLOR= CR
510 HLIN U,T8 AT F7: HLIN L,L +U AT F5: HLIN R,R +U AT F5
520 H = H +U:Q = RND(U): IF Q >RC AND R <ER THEN L = L +U:R = R +U
530 IF Q <LC AND L >EL THEN L = L -U:R = R -U
540 HLIN L,L +U AT F6: HLIN R,R +U AT F6
550 COLOR= CC
600 Q = PEEK(KP): POKE RK,Z
610 IF Q = ML THEN X = X -U
620 IF Q = MR THEN X = X +U
630 IF SCRN( X,Y) = Z THEN GOSUB 3050: GOTO 500
640 GOTO 1000
1000 FOR Q = U TO 6: COLOR= CC: GOSUB 200
1010 FOR J = U TO 100: NEXT : COLOR= Z: GOSUB 200
1020 FOR J = U TO 30:K = PEEK( -16336): NEXT : NEXT
1030 COLOR= CC: GOSUB 200: POKE 32,Z: POKE 33,40: CALL SC
1040 COLOR= Z: FOR Q = U TO 5: HLIN Z,39 AT F7: CALL SC
1050 NEXT : POKE -16304,0: POKE 34,20: POKE -16301,0: HOME
1060 M = H *5:T = T +M
1070 PRINT "YOU WENT ";M;: GOSUB 1300
1080 PRINT TAB( 28);"NOW HIT
1090 PRINT "MILES FOR A TOTAL";: GOSUB 1300
1100 PRINT TAB( 25);"'C' - CONTINUE
1110 PRINT "OF ";T;" MILES";: GOSUB 1300
1120 PRINT TAB( 25);"'R' - RESTART
1130 PRINT "IN ";N;" DAY(S)";: GOSUB 1300
1140 PRINT TAB( 25);"'Q' - QUIT ";
1150 GET Q$: IF Q$ = "C" THEN 330
1160 IF Q$ < >"R" AND Q$ < >"Q" THEN 1150
1170 TEXT : HOME : PRINT
1180 PRINT "AVERAGE MILES PER DAY=";T/N
1190 PRINT : PRINT : PRINT : IF Q$ = "R" THEN 220
1200 END
1300 PRINT TAB( 21);: PRINT "!";: RETURN
1310 NORMAL : RETURN
2000 GR : HOME : COLOR= CR: RESTORE
2010 X = 16:Y = 0: PLOT X,Y: PLOT X +8,Y
2020 FOR Y = 1 TO 39: READ Q:X = X +Q -U
2030 PLOT X,Y: PLOT X +8,Y: NEXT
2040 COLOR= CC:X = 20: RESTORE
2050 FOR Y = 1 TO 39: READ Q:X = X +Q -U
2060 GOSUB 200: FOR J = 1 TO 30: NEXT
2070 COLOR= Z: GOSUB 200: COLOR= CC: NEXT :Y = 39: GOSUB 200
2080 FOR J = 1 TO 25:Q = PEEK( -16336): NEXT
2090 FOR J = 1 TO 6: HOME : PRINT TAB( 7);
2100 PRINT "R O A D R A C E
2110 FOR Q = 1 TO 500: NEXT : HOME : PRINT : PRINT
2120 FOR Q = 1 TO 250: NEXT : NEXT : RETURN
2200 DATA 1,1,1,1,1,1,1,2,2,2,2,2,2,2
2210 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0
2220 DATA 2,2,2,2,2,2,2,1,1,1,1
3000 COLOR= CR: VLIN Y -10,Y AT L -5
3010 VLIN Y -10,Y AT L -3: FOR Q = Y -10 TO Y STEP 2
3020 PLOT L -4,Q: NEXT : FOR Q = 1 TO 1000: NEXT
3030 COLOR= CC: FOR Q = Y -9 TO Y -1 STEP 2
3040 FOR J = 1 TO 500: NEXT : PLOT L -4,Q: NEXT : RETURN
3050 COLOR= Z: PLOT X -1,Y -1: PLOT X -U -1,Y -U -1: PLOT X +U -1,Y -U -1: COLOR= CC: GOTO 200
4000 PRINT "WOULD YOU LIKE INSTRUCTIONS?
4010 POKE RK,0: WAIT KP,128:A$ = CHR$( PEEK(KP) -128): POKE RK,0: IF A$ = "Y" OR A$ = "N" THEN 4030
4020 GOTO 4010
4030 IF A$ = "N" THEN 4050
4040 PRINT "IN THIS GAME, YOU ARE IN CONTROL OF A CAR. YOU CONTROL ITS MOVEMENTS BY PUSHING 'G' TO GO LEFT AND 'H' TO MOVE RIGHT.
4050 PRINT : PRINT "WOULD YOU LIKE TO PLAY?
4060 POKE RK,0: WAIT KP,128:A$ = CHR$( PEEK(KP) -128): POKE RK,0: IF A$ = "Y" OR A$ = "N" THEN 4080
4070 GOTO 4060
4080 IF A$ = "N" THEN 1200
4090 RETURN
5000 REM TYPED FOR ACGNJ BY JIM LIU